import java.util.Arrays;

public class SelectSort {
    public static void main(String[] args) {
        int array[] = {3,6,2,9,4};
        int min = array[0];

        //选择排序
        for(int i = 0; i < array.length - 1; i++){
            for(int j = i; j < array.length; j++){
                if(array[i] > array[j]){
                    min = array[j];
                    array[j] = array[i];
                    array[i] = min;
                }
            }
        }
        System.out.println(Arrays.toString(array));
    }
}
